<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\web\View;
use kartik\date\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\SchoolinfoModel */
/* @var $form yii\widgets\ActiveForm */
$url=\Yii::getAlias('@web');
$js3=<<< Js
function myAjax(){
		var x=$("#schoolinfomodel-stu_id").val();
		$.ajax({
                    url: '$url/personinfo/getname?stuid='+x,
                    type: 'get',
                    dataType: 'text',
                    success: function (data) {
                       $("#schoolinfomodel-name").val(data);
                    }
                });
}
Js;
$this->registerJs($js3, View::POS_END, 'myAjax0');
?>

<div class="schoolinfo-model-form">

    <?php $form = ActiveForm::begin(); ?>

        <?= $form->field($model, 'stu_id')->textInput(['maxlength' => true,
    		'onblur'=>'myAjax()',
    ]) ?>
    <?= $form->field($model, 'name')->textInput(['maxlength' => true,
    		'readonly'=>true,
    ]) ?>
    <?= $form->field($model, 'enroll_time')->widget(DatePicker::classname(), [
        'options' => ['placeholder' => 'Enter birth date ...'],
        'pluginOptions' => [
            'autoclose'=>true,
            'format' => 'yyyy.mm'
        ]
    ])->label('入学时间'); ?>

    <?= $form->field($model, 'stu_type')->dropDownList(['0'=>'本科生','1'=>'硕士研究生','2'=>'博士研究生']) ?>

    <?= $form->field($model, 'major_name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'class_name')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'status')->dropDownList
    				(['0'=>'在读','1'=>'休学','2'=>'退学','3'=>'保留入学资格',
    					'4'=>'毕业','5'=>'肄业','6'=>'开除','7'=>'在读（在外校交流）',
    						'8'=>'在本校交流学习','9'=>'在本校交流学习结束']) ?>



    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '添加' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
